package cn.tk.model.pojo.mr.flow;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * Created by denglw on 2021/7/16.<br/>
 * Desc: 实体澄清对象
 */
@Data @NoArgsConstructor
public class EntityClarify {

    /**
     * 节点id
     */
    private Long nodeId;

    /**
     * 对应的实体值
     */
    private Long entityId;

    /**
     * 是否必须澄清：0否 1是
     */
    private Boolean necessary;

    /**
     * 非必须澄清情况下，澄清失败默认澄清的实体值id
     */
    private Long defaultEntityValueId;

    /**
     * 最大澄清次数
     */
    private Integer clarifyNum;

    /**
     * 达到最大澄清次数后的兜底话术id
     */
    private Long bottomReplyId;

    /**
     * 澄清话术列表 临时字段(用于承接数据库查询结果)
     */
    private String clarifyReplyTemp;

    /**
     * 具体的澄清话术列表
     */
    private List<ClarifyReply> clarifyReplies;

    public EntityClarify(Long nodeId, Long entityId, Boolean necessary,
                         Long defaultEntityValueId, Integer clarifyNum, Long bottomReplyId, String clarifyReplyTemp) {
        this.nodeId = nodeId;
        this.entityId = entityId;
        this.necessary = necessary;
        this.defaultEntityValueId = defaultEntityValueId;
        this.clarifyNum = clarifyNum;
        this.bottomReplyId = bottomReplyId;
        this.clarifyReplyTemp = clarifyReplyTemp;
    }

    @Data @NoArgsConstructor
    public static class ClarifyReply {
        /**
         * 关联澄清话术id
         */
        private Long replyId;

        /**
         * 次序号
         */
        private Integer sortNum;

        public ClarifyReply(Long replyId, Integer sortNum) {
            this.replyId = replyId;
            this.sortNum = sortNum;
        }
    }

}
